<template>
  <div>
    <ZgEdit
      ref="dialog"
      :view="view"
      :columns="columns"
      :formulas="formulas"
      :inputClick="inputClick"
      validUrl=""
      saveUrl=""
      @ok="$emit('ok')">
    </ZgEdit>
  </div>
</template>
<script>
export default {
  data () {
    return {
      obj: null,
      view: { width: '50%', top: '5%', title: '处理' },
      columns: [
        { name: '操作说明', code: 'memo', compType: '多行文本', isNeed: true, offset: 0, span: 24, defaultVal: '', extra: { 行数: 4 } }
      ],
      formulas: [
        { triggerMode: '初始化时', name: '公式1', content: 'console.log("init");' },
        { triggerMode: '数据变化时', name: '公式2', content: 'console.log("update");' },
        { triggerMode: '提交时', name: '公式3', content: 'console.log("submit");' }
      ]
    }
  },
  methods: {
    open (json) {
      this.obj = Object.assign({}, this.obj, json || {})
      this.$refs.dialog.open()
    },
    inputClick (t) {
    //   alert(JSON.stringify(t))
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
